<?php
namespace app\english\controller;

use think\Controller;
use think\Request;
use think\Config;
use think\Db;

class Common extends Controller
{   
	 //token
    protected $token = '';
    //用户 id
    protected $userId = 0;
    //用户
    protected $user;

    //小程序id
    protected $wechatId;
  
    // 初始化
    public function __construct()
    {   
        parent::__construct();

        $this->token    = $this->request->header('XX-Token');
        $this->wechatId = $this->request->header('XX-WxappId');
        $this->user     = Db::name('user')->field('id,session_key,openid')->where('token',$this->token)->find();
        $this->userId   = $this->user['id'];
    }
}
